package Cn.Sarkar.MMS.Entities.Independent.Permission

import Cn.Sarkar.Entities.Common.Additional.IDescription
import Cn.Sarkar.Entities.Common.Additional.IName
import Cn.Sarkar.Entities.Common.Independent.IApplicationDomain
import Cn.Sarkar.Entities.MMS.Independent.Permission.IPermissionGroup
import Cn.Sarkar.EntityDream.CoreEngine.RDBMS.Core.Extensions.hasOne
import Cn.Sarkar.EntityDream.CoreEngine.RDBMS.IDataContext
import Cn.Sarkar.MMS.DataBaseDefinations.Independent.Permission.PermissionGroups
import Cn.Sarkar.MMS.Entities.Additional.Description
import Cn.Sarkar.MMS.Entities.Additional.Name
import Cn.Sarkar.Entities.Common.BaseEntity
import Cn.Sarkar.MMS.Entities.Independent.ApplicationDomain

class PermissionGroup(DataContext: IDataContext) : BaseEntity(DataContext, PermissionGroups), IPermissionGroup {
    var applicationDomainID by PermissionGroups.ApplicationDomainID
    override var applicationDomain: IApplicationDomain by hasOne(PermissionGroups.ApplicationDomainID) { ApplicationDomain(it) }
    var nameID by PermissionGroups.NameID
    override var name: IName by hasOne(PermissionGroups.NameID) { Name(it) }
    var descriptionID by PermissionGroups.DescriptionID
    override var description: IDescription by hasOne(PermissionGroups.DescriptionID) { Description(it) }
}